package com.ssy.lingxi.platform.manage.repository;


import com.ssy.lingxi.platform.manage.entity.content.MemberInformationCollect;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

@Repository
public interface MemberInformationCollectRepository extends JpaRepository<MemberInformationCollect, Long>, JpaSpecificationExecutor<MemberInformationCollect> {

    void deleteByInformationIdAndMemberIdAndUserId(Long informationId, Long memberId, Long userId);

    Boolean existsByInformationIdAndMemberIdAndUserId(Long informationId, Long memberId, Long userId);

    void deleteByInformationId(Long id);

    Page<MemberInformationCollect> findAllByMemberIdAndUserId(Long memberId, Long userId, Pageable page);

    Page<MemberInformationCollect> findAllByMemberIdAndUserIdAndSelfMemberId(Long memberId, Long userId, Long selfMemberId, Pageable page);
}
